<?php
require_once './include/common.inc.php';
require_once 'left.php';
require_once 'right.php';
include_once './include/cart.class_p.php';

@header("Content-Type:text/html;charset=iso-8859-1");
$page_title = 'Acuity World WebShop';
$menu_id = 0;
$menu_str = PrintMenu();

$promoter_uid= $_POST['pid'] ;
$sql = "SELECT * FROM  `promoter_info` WHERE  `id` = '" . $promoter_uid . "'";
$user_info_ary = $db->get_one($sql);
if (empty($user_info_ary)) {
    header("location:" . $WEB_URL . "shopping_cart_p.php?checkout");
    exit;
}

$faq2_checked = $_POST['faq2'];

if (isset($_POST['set_country']) &&  $_POST['set_country']>=0 && $_POST['set_country']<3) {
    $set_country = $_POST['set_country'];
} elseif (isset($_SESSION['myCart_country']) &&  $_SESSION['myCart_country']>=0 && $_SESSION['myCart_country']<3) {
    $set_country = $_SESSION['myCart_country'];
} else {
    $set_country = 0;
}

$card_name = $_POST['card_name'];
$card_number = $_POST['card_number'];
$card_type = $_POST['card_type'];
$card_emonth = $_POST['card_emonth'];
$card_eyear = $_POST['card_eyear'];
$card_cvc = $_POST['card_cvc'];

if ($_POST['userdef'] == 1) {   //ûͶݵַ
    $user_street = $_POST['user_street'];
    $user_city = $_POST['user_city'];
    $user_zip = $_POST['user_zip'];
    $user_state = $_POST['user_state'];
    $user_country = $_POST['user_country'];
} else {
    $user_street = $user_info_ary['street2'];
    $user_city = $user_info_ary['city2'];
    $user_zip = $user_info_ary['zip2'];
    $user_state = $user_info_ary['state2'];
    $user_country = $user_info_ary['country2'];
}

$cart = new cart();
$pay_amount = $cart->getPayAmount();

//$info_ary = $cart->getData();
//$total_qty = $cart->getSortCount();
//$total_cost = $cart->getTotalCost();
//$total_cost2 = $cart->getTotalCost2();
//
//$cart_addvat = $cart->getAddVat();
//$cart_addshippingfee = $cart->getAddShippingFee();
//$cart_discount = $cart->getDisCount();

setPromoterCartInfo($promoter_uid, serialize($cart));
$cart->emptyAll();
$new_total_cost = number_format(round($total_cost - $cart_discount, 2), 2, '.', '');

$pay_amount=$_POST["pay_amount"];

$paymentBOX['baseURL']			= 'https://betaling.wannafind.dk/';
$paymentBOX['proxyURL']			= $paymentBOX['baseURL'].'proxy/p.php/';

$pay_url = $paymentBOX['proxyURL'] .'http://'. $paymentBOX['mydomain'].$paymentBOX['path'] . "promoter_jumppay2.php";
//$pay_url = "promoter_jumppay2.php";

require_once PrintEot('promoter_jumppay');


?>